package work727;

import java.util.Date;

//销售员工
public class SalesEmploee extends Worker implements SalarySum{
  private int benefitsWage;//效益工资
  private  int personalSales;//个人销售额
  private  double cper;//提成比例

  public SalesEmploee() {

  }

  public SalesEmploee(int id, String name, String sex, int age, String rank, String education, String department, Date date, int personalSales) {
    super(id, name, sex, age, rank, education, department, date);
    this.personalSales = personalSales;
  }

  public int getBenefitsWage() {

    return benefitsWage;
  }

  public int getPersonalSales() {
    return personalSales;
  }

  public void setPersonalSales(int personalSales) {
    this.personalSales = personalSales;
  }

  public double getCper() {
    if (getPersonalSales()> 1000){
      return 0.1;
    }else {
    return 0.05;
  }
  }

  @Override
  public void sum() {
    super.setSalary(super.getBasewage() + this.getPersonalSales()* this.getCper());
    System.out.println("编号："+super.getId()+",姓名："+super.getName()+",性别："
      +super.getSex()+",年龄："+super.getAge()+",职称："+super.getRank()+",学历："
      + super.getEducation()+",所在部门："+super.getDepartment()+",入职日期："+super.getDate()+
      ",实发工资："+super.getSalary());
  }
}
